package com.dfbz.demo02_静态代理解决问题;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01 {

    public static void main(String[] args) {


        UserService userService = new UserServiceProxy(new UserServiceImpl());

        userService.add();
        userService.delete(10);
        userService.update(20);
        String res = userService.query();
        System.out.println(res);

    }

    public static void test(String[] args) {

        // 直接创建真实对象
        UserService userService = new UserServiceImpl();

        userService.add();
        userService.delete(10);
        userService.update(20);
        String res = userService.query();
        System.out.println(res);

    }
}
